/**
 * Created with IntelliJ IDEA.
 * User: skyline{http://my.oschina.net/skyline520}
 * Date: 12-11-23
 * Time: 下午3:44
 * To change this template use File | Settings | File Templates.
 */
Ext.define('Airways.view.system.roleuser.UserGridPanel',{
    extend:'Ext.grid.Panel',
    alias:'widget.roleUserUserGridPanel',
    anchor:'100% 80%',
    header:false,
    bodyBorder:false,
    autoScroll:false,
    forceFit:true,
    selModel:Ext.create('Ext.selection.CheckboxModel'),
    store:Ext.create('Airways.store.system.roleuser.RoleUserUserManageStore'),
    viewConfig:{
        loadMask: new Ext.LoadMask(this,{msg:'数据加载中,请稍后...'})
    },
    initComponent:function (){
        this.columns = this.buildColumns();
        this.callParent(arguments);
    },
    buildColumns:function(){
        return [Ext.create('Ext.grid.RowNumberer'),
            {text:'用户名',dataIndex:'userNo'},
            {text:'用户中文名',dataIndex:'userName'},
            {text:'分部',dataIndex:'subsectionName'},
            {text:'邮件',dataIndex:'userMail'},
            {text:'状态',dataIndex:'status',renderer:this.changeStatus}]
    },
    //rendder status 转化 0 1 为 禁用  启用
    changeStatus:function(val) {
        if (val == 0) return "禁用";
        if (val == 1) return "启用";
    }
});
